const { DataTypes } = require('sequelize');
const defineModel = require('@/config/database');
const Model = defineModel('xs_post', {
	username: {
		type: DataTypes.STRING(20),
		comment: '岗位名称',
		unique: true
	},
	password: {
		type: DataTypes.STRING(50),
		comment: '用户密码'
	},
	nickname: {
		type: DataTypes.STRING(50),
		allowNull: true,
		comment: '用户昵称'
	},
	avatar: {
		type: DataTypes.STRING,
		allowNull: true,
		comment: '用户头像'
	},
	email: {
		type: DataTypes.STRING,
		allowNull: true,
		comment: '用户邮箱'
	},
	phone: {
		type: DataTypes.BIGINT(11),
		comment: '用户电话'
	},
	status: {
		type: DataTypes.INTEGER(1),
		allowNull: true,
		comment: '用户状态'
	},
	createtime: {
		type: DataTypes.DATE,
		comment: '创建时间'
	},
	updatetime: {
		type: DataTypes.DATE,
		comment: '更新时间'
	}
});
Model.beforeCreate((model, options) => {
	// console.log(model, options);
});
module.exports = Model;